import fly from "./http"
class Apis {
    //轮播图
    getSwiperImg(){
        return fly.request("/crminterface/Interf/banner",{},{
              method:"POST"
          })
    }
    //新闻分类
    getNewsClassify(){
        return fly.request("/crminterface/Interf/new_type",{},{
              method:"POST"
          })
    }
    // 、、新闻列表
    getNewsList(data){
        return fly.request("/crminterface/Interf/new_list",{
            page:data.page,
            s_page:data.s_page,
            search:data.search,
            type_id:data.type_id
        },{
            method:"POST"
        })
    }
    getNewsDetail(data){
        return fly.request("/crminterface/Interf/new_details",{
            inf_id:data.inf_id,
            openid:data.optid,
            type:data.type,
            inf_source:data.inf_source
        },{
            method:"POST"
        })
    }
    getHotNews(){
        return fly.request("/crminterface/Interf/hot_news",{ },{
            method:"POST"
        })
    }
    getLoginCode(code){
        return fly.request(
             "/crminterface/Interf/opendid",
            {code},{method:"POST"})
    }
    getPhoneCode(data){
        return fly.request("/crminterface/Interf/inf_mobile",{mobile:data.mobile,type:data.type},{method:"POST"})
    }
    getAuthentication(data){
        return fly.request("/crminterface/Interf/authentication",{
            code:data.code,
            tel:data.tel,
            openid:data.openid,
            avatarurl:data.avatarurl,
            nickname:data.nickname,
            gender:data.gender
        },{method:"POST"})
    }
    //修改个人信息
    setProfileData(data){
        let{wx,title,avatarurl,brief,email,openid}=data
        return fly.request("/crminterface/Interf/userinfo_edit",{wx,title,avatarurl,brief,email,openid},{
            method:"POST"
        })
    }
    //获取转发者的名片信息
    getProfileData(data){
        return fly.request("/crminterface/Interf/get_userinfo",{openid:data},{method:"POST"})
    }

}
export default new Apis();